aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/[id]/+page.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-10-04 20:28:29 -0700
committerAdam Soltys <[email protected]>2022-10-04 20:28:29 -0700
commit59d43ba294e49cbb46ea4d2d0ddb0d22bbc7ba6e (patch)
treedead06dbd4ba44f0044ba916a5294ceccf6511fe /src/routes/invoice/[id]/+page.svelte
parent4f03f2401cc7bc58420dd2236ffb6c3424c79b32 (diff)
downloadcoinos-ui-59d43ba294e49cbb46ea4d2d0ddb0d22bbc7ba6e.tar.gz
coinos-ui-59d43ba294e49cbb46ea4d2d0ddb0d22bbc7ba6e.zip
tipping fixes
Diffstat (limited to 'src/routes/invoice/[id]/+page.svelte')
-rw-r--r--src/routes/invoice/[id]/+page.svelte9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte
index 9d140bd5..04a31813 100644
--- a/src/routes/invoice/[id]/+page.svelte
+++ b/src/routes/invoice/[id]/+page.svelte
@@ -19,7 +19,6 @@
user: { username, currency }
} = invoice;
- let showCustomAmount = false;
let showMobileTip = false;
let qr;
@@ -39,15 +38,13 @@
user: { username, currency }
} = invoice);
- amount -= tip;
-
tipPercent = (tip / amount) * 100;
};
$: tip = Math.round((amount / 100) * tipPercent);
$invoices[id] = { amount, id, rate, received, text, tip, username };
- $: $invoices[id]?.received >= $invoices[id]?.amount && goto(`/invoice/${id}/paid`);
+ $: browser && $invoices[id]?.received >= $invoices[id]?.amount && goto(`/invoice/${id}/paid`);
$: amountFiat = parseFloat(((amount * rate) / sats).toFixed(2));
@@ -73,15 +70,11 @@
{#if invoice.prompt}
<Tip
bind:amountFiat
- bind:showCustomAmount
bind:showMobileTip
bind:tipPercent
bind:tipAmount
bind:amount
bind:tip
- bind:rate
- bind:prompt
- bind:text
bind:currency
bind:username
/>